Make it possible to load siglip models from local files#22
Make it possible to load siglip models from local files#22maxlund wants to merge 2 commits intoBlaizzy:mainfrom
Conversation
- read img and patch size if supplied in model_config arg
There was a problem hiding this comment.
not sure if you want to pin this to some version, just thought I'd add it since I can't run the repo without torch installed
|
Hey @maxlund Thanks for the PR! The context is that for certain models they don't supply the patch and img size on the Besides torch, which I will address today. Are you having trouble with any Siglip model in particular? |
|
Hey no problem, messing around with it now and running into some issues. This seems to work fine and gives me embeddings for both text and images. But I want to extract them in separate steps of my pipeline. This: gives me: get_text_features and get_image_features using but ran into other issues.. |
|
Okay some progress.. |
|
|
Okay this did the trick I think Might be able to get some benchmarks soon if no other road bumps |
There was a problem hiding this comment.
👌
Any idea why running on MLX doesn't seem to give us any noticable performance gains compared to torch on MPS?
Read img and patch size if supplied in model_config arg.
What is the context for the regex parsing of the repo name, the img/patch size isn't always correct in the
config.jsonfile I guess? Anyway this small change makes it possible to load a local model while being offline:FWIW the image and patch size seemed to be correct for both
mlx-community/siglip-large-patch16-384andmlx-community/siglip-so400m-patch14-384via downloadedconfig.jsonin the hf repos